package com.jtpay.sdk.activity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;

import com.jtpay.sdk.jtpay.constant.PayConstant;
import com.jtpay.sdk.jtpay.utils.PayLogUtil;

/**
 * Created by Steven on 2016/11/28 0028.
 */

public class WeinxinShareReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();

        if (!TextUtils.isEmpty(action)) {
            if (PayConstant.ACTION_WEIXIN_CALLBACK.equals(action)) {
                PayLogUtil.log("WeinxinShareReceiver onReceive action = " + action);
                if (intent.hasExtra(PayConstant.EXTRA_WEIXIN_RESULT)) {
                    int errorCode = intent.getIntExtra(PayConstant.EXTRA_WEIXIN_RESULT, -101);
                    PayLogUtil.log("WeinxinShareReceiver  errorCode = " + errorCode);
                }
            }
        }
    }
}
